#include<stdio.h>
int main()
{
	int time=0,hour=0,minute=0,add=0,m=0,hour1=0,minute1=0,n=0;
	scanf("%d %d",&time,&add);
	hour=time/100;
	minute=time%100;
	m=hour*60+minute;
	hour1=(m+add)/60;
	minute1=(m+add)%60;
	n=hour1*100+minute1;
	printf("%d",n);
	return 0;
}
